import allure

from utils.yaml_util import read_config_yaml

item_name = read_config_yaml("item","item_name")

def dynamic_title(caseinfo):
    allure.dynamic.parameter("caseinfo","")

    if item_name:
        allure.dynamic.epic(item_name)
    if caseinfo.get("feature",None) is not None:
        allure.dynamic.feature(caseinfo["feature"])
    if caseinfo.get("story",None) is not None:
        allure.dynamic.story(caseinfo["story"])
    if caseinfo.get("title",None) is not None:
        allure.dynamic.title(caseinfo["title"])